<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="tips"></div>
</body>
<script>
    show();
    // 倒计时  距离双11剁手还有xx天xx时xx分xx秒 (忽略毫秒) 
    function show(){
        var tips = document.getElementById("tips");
        var now = new Date();
        var shuang =new Date(2021,10,11,00,00,00);
        var ms = (shuang * 1 - now * 1) /1000 ;
        var day = parseInt(ms / (60 * 60 * 24));
        var hour = parseInt(ms / (60 * 60)) % 24;
        var min = parseInt(ms / 60) % 60;
        var s = parseInt(ms % 60);
        var date = "距离双11还有:" + day + "天" + hour + "小时" +min + "分钟"  + s + "秒";
        tips.innerText = date;
    }
    var timer1 = setInterval( show,1000);
</script>
</html>